package org.example.proxy;

public class Proxy implements Subject{

    private Subject subject;

    public Proxy(Subject subject){
        this.subject=subject;
    }

    private void before(){
        System.out.println("前置处理");
    }

    private void after(){
        System.out.println("后置处理");
    }



    @Override
    public void request() {
        this.before();
        subject.request();
        this.after();
    }
}
